import time

from crawler.connection import filter_push_redis, redis_conn, redis_shedana

url_list = [{'category': '所有服饰>>上衣 & T 恤', 'ids': 'mens|clothing|tops-t-shirts', 'sex': 'men'},
            {'category': '所有服饰>>外套 & 夹克', 'ids': 'mens|clothing|coats-jackets', 'sex': 'men'},
            {'category': '所有服饰>>运动装', 'ids': 'mens|clothing|sweats', 'sex': 'men'},
            {'category': '所有服饰>>衬衫', 'ids': 'mens|clothing|shirts', 'sex': 'men'},
            {'category': '所有服饰>>牛仔裤', 'ids': 'mens|clothing|jeans', 'sex': 'men'},
            {'category': '所有服饰>>长裤 & 短裤', 'ids': 'mens|clothing|trousers-shorts', 'sex': 'men'},
            {'category': '所有服饰>>针织衫', 'ids': 'mens|clothing|knitwear', 'sex': 'men'},
            {'category': '所有服饰>>西装 & 精裁服饰', 'ids': 'mens|clothing|suits-tailoring', 'sex': 'men'},
            {'category': '所有服饰>>内衣 & 袜子', 'ids': 'mens|clothing|underwear-socks', 'sex': 'men'},
            {'category': '所有服饰>>睡衣 & 家居服', 'ids': 'mens|clothing|nightwear-loungewear', 'sex': 'men'},
            {'category': '所有服饰>>泳装', 'ids': 'mens|clothing|swimwear', 'sex': 'men'},
            {'category': '所有服饰>>运动装', 'ids': 'mens|clothing|sportswear', 'sex': 'men'},
            {'category': '所有服饰>>西装外套', 'ids': 'mens|clothing|blazers', 'sex': 'men'},
            {'category': '所有服饰>>滑雪装', 'ids': 'mens|clothing|ski-wear', 'sex': 'men'},
            {'category': '鞋子>>拖鞋', 'ids': 'shoes|mens|shoes|slippers', 'sex': 'men'},
            {'category': '鞋子>>乐福鞋', 'ids': 'shoes|mens|loafers', 'sex': 'men'},
            {'category': '鞋子>>凉拖鞋', 'ids': 'shoes|mens|sandals|sliders-flip-flops', 'sex': 'men'},
            {'category': '鞋子>>夏日凉鞋', 'ids': 'shoes|mens|sandals', 'sex': 'men'},
            {'category': '鞋子>>运动鞋', 'ids': 'shoes|mens|trainers', 'sex': 'men'},
            {'category': '鞋子>>鞋履', 'ids': 'shoes|mens|shoes', 'sex': 'men'},
            {'category': '鞋子>>婚礼鞋履', 'ids': 'wedding-shop|groom|shoes', 'sex': 'men'},
            {'category': '鞋子>>靴子', 'ids': 'shoes|mens|boots', 'sex': 'men'},
            {'category': '鞋子>>女孩', 'ids': 'shoes|kids|girls', 'sex': 'kids'},
            {'category': '鞋子>>男孩', 'ids': 'shoes|kids|boys', 'sex': 'kids'},
            {'category': '鞋子>>婴儿', 'ids': 'shoes|kids|baby', 'sex': 'kids'},
            {'category': '包袋>>双肩包', 'ids': 'bags|mens|backpacks', 'sex': 'men'},
            {'category': '包袋>>托特包', 'ids': 'bags|mens|tote-bags', 'sex': 'men'},
            {'category': '包袋>>洗漱包', 'ids': 'bags|mens|wash-bags', 'sex': 'men'},
            {'category': '包袋>>婴儿换洗包袋', 'ids': 'kids|baby|changing-bags-mats|bags', 'sex': 'baby'},
            {'category': '包袋>>男童包袋', 'ids': 'kids|boys|accessories|bags', 'sex': 'boys'},
            {'category': '包袋>>女童包袋', 'ids': 'kids|girls|accessories|bags', 'sex': 'girls'},
            {'category': '包袋>>邮差包', 'ids': 'bags|mens|messenger-bags', 'sex': 'men'},
            {'category': '包袋>>公文包', 'ids': 'bags|mens|briefcases', 'sex': 'men'},
            {'category': '包袋>>腰包', 'ids': 'bags|mens|belt-bags', 'sex': 'men'},
            {'category': '包袋>>旅行包袋', 'ids': 'bags|mens|travel-bags', 'sex': 'men'},
            {'category': '配饰>>珠宝', 'ids': 'mens|accessories|jewellery', 'sex': 'men'},
            {'category': '配饰>>腰带', 'ids': 'mens|accessories|belts', 'sex': 'men'},
            {'category': '配饰>>太阳镜', 'ids': 'mens|accessories|sunglasses', 'sex': 'men'},
            {'category': '配饰>>卡夹', 'ids': 'mens|accessories|wallets|cardholders', 'sex': 'men'},
            {'category': '配饰>>钱夹', 'ids': 'mens|accessories|wallets', 'sex': 'men'},
            {'category': '配饰>>帽子', 'ids': 'mens|accessories|hats', 'sex': 'men'},
            {'category': '配饰>>腕表', 'ids': 'mens|accessories|watches', 'sex': 'men'},
            {'category': '配饰>>领带', 'ids': 'mens|accessories|ties', 'sex': 'men'},
            {'category': '配饰>>眼镜', 'ids': 'mens|accessories|glasses', 'sex': 'men'},
            {'category': '配饰>>围巾', 'ids': 'mens|accessories|scarves', 'sex': 'men'},
            {'category': '配饰>>休闲配饰', 'ids': 'mens|accessories|lifestyle-accessories', 'sex': 'men'},
            {'category': '所有服饰>>连衣裙', 'ids': 'womens|clothing|dresses', 'sex': 'women'},
            {'category': '所有服饰>>上衣', 'ids': 'womens|clothing|tops', 'sex': 'women'},
            {'category': '所有服饰>>外套 & 夹克', 'ids': 'womens|clothing|coats-jackets', 'sex': 'women'},
            {'category': '所有服饰>>针织衫', 'ids': 'womens|clothing|knitwear', 'sex': 'women'},
            {'category': '所有服饰>>睡衣 & 内衣', 'ids': 'womens|clothing|nightwear-lingerie', 'sex': 'women'},
            {'category': '所有服饰>>运动装', 'ids': 'womens|clothing|sportswear', 'sex': 'women'},
            {'category': '所有服饰>>滑雪装', 'ids': 'womens|clothing|sportswear|ski-wear', 'sex': 'women'},
            {'category': '所有服饰>>长裤', 'ids': 'womens|clothing|trousers', 'sex': 'women'},
            {'category': '所有服饰>>牛仔裤', 'ids': 'womens|clothing|jeans', 'sex': 'women'},
            {'category': '所有服饰>>半身裙', 'ids': 'womens|clothing|skirts', 'sex': 'women'},
            {'category': '所有服饰>>连身裤', 'ids': 'womens|clothing|jumpsuits-playsuits', 'sex': 'women'},
            {'category': '所有服饰>>丹宁', 'ids': 'womens|clothing|denim', 'sex': 'women'},
            {'category': '所有服饰>>泳装 & 沙滩装', 'ids': 'womens|clothing|swimwear-beachwear', 'sex': 'women'},
            {'category': '所有服饰>>衬衫 ', 'ids': 'womens|clothing|tops|shirts-blouses', 'sex': 'women'},
            {'category': '所有服饰>>T 恤', 'ids': 'womens|clothing|tops|t-shirts-vests', 'sex': 'women'},
            {'category': '所有服饰>>连帽衫 & 运动衫', 'ids': 'womens|clothing|tops|hoodies-sweatshirts', 'sex': 'women'},
            {'category': '所有服饰>>短裤 ', 'ids': 'womens|clothing|trousers|shorts', 'sex': 'women'},
            {'category': '所有服饰>>袜子', 'ids': 'womens|clothing|nightwear-lingerie|lingerie|hosiery|socks',
             'sex': 'women'}, {'category': '鞋子>>夏日凉鞋', 'ids': 'shoes|womens|sandals', 'sex': 'women'},
            {'category': '鞋子>>高跟凉鞋', 'ids': 'shoes|womens|sandals|heeled-sandals', 'sex': 'women'},
            {'category': '鞋子>>平底凉鞋', 'ids': 'shoes|womens|sandals|flat-sandals', 'sex': 'women'},
            {'category': '鞋子>>坡跟凉鞋', 'ids': 'shoes|womens|sandals|wedge-sandals', 'sex': 'women'},
            {'category': '鞋子>>运动鞋', 'ids': 'shoes|womens|trainers', 'sex': 'women'},
            {'category': '鞋子>>高跟鞋', 'ids': 'shoes|womens|heels', 'sex': 'women'},
            {'category': '鞋子>>晚装鞋履', 'ids': 'shoes|womens|evening-shoes', 'sex': 'women'},
            {'category': '鞋子>>婚鞋', 'ids': 'wedding-shop|bridalwear|shoes', 'sex': 'women'},
            {'category': '鞋子>>平底鞋', 'ids': 'shoes|womens|flats', 'sex': 'women'},
            {'category': '鞋子>>穆勒鞋', 'ids': 'shoes|womens|mules', 'sex': 'women'},
            {'category': '鞋子>>乐福鞋', 'ids': 'shoes|womens|flats|loafers', 'sex': 'women'},
            {'category': '鞋子>>靴子', 'ids': 'shoes|womens|boots', 'sex': 'women'},
            {'category': '鞋子>>拖鞋', 'ids': 'shoes|womens|flats|slippers', 'sex': 'women'},
            {'category': '包袋>>中古包袋', 'ids': 'bags', 'sex': 'women'},
            {'category': '包袋>>托特包', 'ids': 'bags|womens|tote-bags', 'sex': 'women'},
            {'category': '包袋>>新娘包袋', 'ids': 'wedding-shop|bridalwear|bags', 'sex': 'women'},
            {'category': '包袋>>迷你包', 'ids': 'bags|womens|mini-bags', 'sex': 'women'},
            {'category': '包袋>>手提包', 'ids': 'bags|womens|top-handle-bags', 'sex': 'women'},
            {'category': '包袋>>超大号包袋', 'ids': 'bags|womens|oversized-bags', 'sex': 'women'},
            {'category': '包袋>>腰包', 'ids': 'bags|womens|belt-bags', 'sex': 'women'},
            {'category': '包袋>>沙滩包', 'ids': 'bags|womens|beach-bags', 'sex': 'women'},
            {'category': '包袋>>钱夹', 'ids': 'womens|accessories|purses-and-pouches|wallets', 'sex': 'women'},
            {'category': '包袋>>洗漱包', 'ids': 'bags|womens|wash-bags', 'sex': 'women'},
            {'category': '包袋>>包袋配饰', 'ids': 'bags|womens|bag-accessories', 'sex': 'women'},
            {'category': '包袋>>斜挎包', 'ids': 'bags|womens|cross-body-bags', 'sex': 'women'},
            {'category': '包袋>>单肩包', 'ids': 'bags|womens|shoulder-bags', 'sex': 'women'},
            {'category': '包袋>>托特包', 'ids': 'bags|w∂çomens|tote-bags', 'sex': 'men'},
            {'category': '包袋>>双肩包', 'ids': 'bags|womens|backpacks', 'sex': 'women'},
            {'category': '包袋>>手拿包', 'ids': 'bags|womens|clutch-bags', 'sex': 'women'},
            {'category': '配饰>>中古配饰', 'ids': 'womens|accessories', 'sex': 'women'},
            {'category': '配饰>>太阳镜', 'ids': 'womens|accessories|sunglasses', 'sex': 'women'},
            {'category': '配饰>>眼镜', 'ids': 'womens|accessories|eyewear', 'sex': 'women'},
            {'category': '配饰>>钱包 & 手包', 'ids': 'womens|accessories|purses-and-pouches', 'sex': 'women'},
            {'category': '配饰>>卡夹', 'ids': 'womens|accessories|purses-and-pouches|cardholders', 'sex': 'women'},
            {'category': '配饰>>腰带', 'ids': 'womens|accessories|belts', 'sex': 'women'},
            {'category': '配饰>>帽子', 'ids': 'womens|accessories|hats', 'sex': 'women'},
            {'category': '配饰>>围巾', 'ids': 'womens|accessories|scarves', 'sex': 'women'},
            {'category': '配饰>>人气珠宝', 'ids': 'jewellery-watches|fine-jewellery', 'sex': 'women'},
            {'category': '配饰>>腕表', 'ids': 'womens|accessories|watches', 'sex': 'women'},
            {'category': '配饰>>发饰', 'ids': 'womens|accessories|hair-accessories', 'sex': 'women'},
            {'category': '珠宝>>耳环', 'ids': 'jewellery-watches|fine-jewellery|earrings', 'sex': 'women'},
            {'category': '珠宝>>项链', 'ids': 'jewellery-watches|fine-jewellery|necklaces', 'sex': 'women'},
            {'category': '珠宝>>戒指', 'ids': 'jewellery-watches|fine-jewellery|rings', 'sex': 'women'},
            {'category': '珠宝>>手镯/手链', 'ids': 'jewellery-watches|fine-jewellery|bracelets', 'sex': 'women'},
            {'category': '珠宝>>结婚戒', 'ids': 'wedding-shop|jewellery|wedding-rings', 'sex': 'women'},
            {'category': '珠宝>>男士高级腕表', 'ids': 'mens|accessories|watches|fine-watches', 'sex': 'men'},
            {'category': '珠宝>>女士高级腕表', 'ids': 'womens|accessories|watches|fine-watches', 'sex': 'women'},
            {'category': '珠宝>>中古珠宝', 'ids': 'womens|accessories|jewellery', 'sex': 'women'},
            {'category': '珠宝>>中古腕表', 'ids': 'jewellery-watches|fine-watches', 'sex': 'men'},
            {'category': '珠宝>>项链', 'ids': 'womens|accessories|jewellery|necklaces', 'sex': 'women'},
            {'category': '珠宝>>耳环', 'ids': 'womens|accessories|jewellery|earrings', 'sex': 'women'},
            {'category': '珠宝>>戒指', 'ids': 'womens|accessories|jewellery|rings', 'sex': 'women'},
            {'category': '珠宝>>手镯/手链', 'ids': 'womens|accessories|jewellery|bracelets', 'sex': 'women'},
            {'category': '珠宝>>婚礼珠宝', 'ids': 'wedding-shop|jewellery', 'sex': 'women'},
            {'category': '珠宝>>订婚戒', 'ids': 'wedding-shop|jewellery|engagement-rings', 'sex': 'women'},
            {'category': '珠宝>>男士时尚腕表', 'ids': 'mens|accessories|watches|fashion-watches', 'sex': 'men'},
            {'category': '珠宝>>女士时尚腕表', 'ids': 'womens|accessories|watches|fashion-watches', 'sex': 'women'},
            {'category': '珠宝>>手镯/手链', 'ids': 'mens|accessories|jewellery|bracelets', 'sex': 'men'},
            {'category': '珠宝>>项链', 'ids': 'mens|accessories|jewellery|necklaces', 'sex': 'men'},
            {'category': '珠宝>>戒指', 'ids': 'mens|accessories|jewellery|rings', 'sex': 'men'},
            {'category': '珠宝>>耳环', 'ids': 'mens|accessories|jewellery|earrings', 'sex': 'men'}]

for index, info in enumerate(url_list):
    task = {
        "jobId": index,
        'info':info,
        'domain': 'selfridges'.upper(),
        'filename': 'main',
        'types': 'electronic_business',
        "scheduleTime": int(time.time() * 1000),
        "triggerChannel": 'SONIC_SPIDER',
    }
    result = filter_push_redis(redis_conn, f'{task["types"]}_{task["filename"]}_{task["domain"]}', task)
    # result = filter_push_redis(redis_shedana, f'{task["types"]}_{task["filename"]}_{task["domain"]}', task)
    print(result)
    input()
